import http from "@/requset"
import type { Banner, HotRecommendItme, Album, ArtistData } from "./type"
enum API {
	BANNER_LIST = "/banner",
	HOTREMOMEND_LIST = "/personalized",
	NEWALBUM_LIST = "/album/newest",
	RANKING_LIST = "/playlist/detail",
	ARTIST_LIST = "/artist/list",
}

// 获取轮播图列表
export const getBanners = () => http.get<Banner[], null>(API.BANNER_LIST)

// 获取热门推荐歌曲列表
export const getHotRecommends = (limit: number) =>
	http.get<HotRecommendItme[], { limit: number }>(API.HOTREMOMEND_LIST, { limit })

// 获取新碟列表
export const getNewAlbums = (limit: number) => http.get<Album[], { limit: number }>(API.NEWALBUM_LIST, { limit })

// 获取榜单列表
export const getRankings = (id: number) => http.get<any, { id: number }>(API.RANKING_LIST, { id })

// 获取歌手列表
export const getArtists = (limit: number) => http.get<ArtistData[], { limit: number }>(API.ARTIST_LIST, { limit })
